package cn.alcatraz.org.domain;

import cn.alcatraz.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
* @Description: 部门表实体类
* @Author: TinyYu
* @Version: 1.0
* @Date:  2022/6/21 16:54
*/
@Data
public class Department extends BaseDomain {


    /* 部门编号 */
    private String sn;

    /* 部门名称 */
    private String name;

    /* 上级部门路径 */
    private String dirPath;

    /* 部门管理员id */
    private Long manager_id;

    /* 上级部门id */
    private Long parent_id;

    /* 状态 */
    private Integer state;

    /* 部门管理员 */
    private Employee manager;

    /* 上级部门 */
    private Department parent;

    /* 下级部门 */
    @JsonInclude(JsonInclude.Include.NON_DEFAULT) // 数据为默认值不返回
    private List<Department> children = new ArrayList<>();

    @Override
    public String toString() {
        return "Department{" +
                "sn='" + sn + '\'' +
                ", name='" + name + '\'' +
                ", dirPath='" + dirPath + '\'' +
                ", manager_id=" + manager_id +
                ", parent_id=" + parent_id +
                ", state=" + state +
                ", manager=" + manager +
                ", parent=" + parent +
                ", children=" + children +
                "} " + super.toString();
    }
}
